﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Business_Shedule.aspx.cs" Inherits="Business_Business_Shedule" MasterPageFile="../SelectMasterPage.master" %>
<%@ Import Namespace="Common" %>
<%@ Import Namespace="DAL" %>

<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <script type="text/javascript">
        function CV1(source, args) {

            var date1 = document.getElementById('<%= TechOneD.ClientID %>');
            var date2 = document.getElementById('<%= TechTwoD.ClientID %>');

            var h1 = document.getElementById('<%= TechOneT_H.ClientID %>');
            var h2 = document.getElementById('<%= TechTwoT_H.ClientID %>');

            var m1 = document.getElementById('<%= TechOneT_M.ClientID %>');
            var m2 = document.getElementById('<%= TechTwoT_M.ClientID %>');

            var t1 = new Date(date1.value.replace(/-/g, "/") + ' ' + h1.value + ':' + m1.value + ':00');
            var t2 = new Date(date2.value.replace(/-/g, "/") + ' ' + h2.value + ':' + m2.value + ':00');

            if (t1 >= t2)
            { args.IsValid = false; }
            else
            { args.IsValid = true; }
        }
    </script>
    <script type="text/javascript">
        function SetT(obj, clientid) {
            document.getElementById(clientid).value = obj.value;
        }
    </script>
    <table cellpadding="0" cellspacing="2" width="100%" border="0">
	<tr>
		<td width="85%" valign="top">
		<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center">
			<tr>
		        <td class="leftTd"  valign="top">
		        <table cellpadding="0" cellspacing="0" width="100%" border="0" align="center">
		        	<tr>
		            	<td class="titleStyle">任务指定</td>
		            </tr>
		        </table>
		        <br />
		        <table cellpadding="0" cellspacing="1" width="100%" border="0" style="background:#000066;">
	                <form method="post" action="" name="AddForm" onSubmit="return CheckAddNew()">
	                 <input type="hidden" name="Oper" value="AddNews"> 
	                    <tr>
	                        <td class="leftContent">任务类型：</td>
	                        <td class="RightContent"><%=  new News().GetClsName(news.ClsID) %></td>
	                    </tr>
                        <%  if (news.ClsID.Contains("4"))
                            { %>
	                    <tr>
	                        <td class="leftContent" valign="top" style="padding-top:5px;">送/取：</td>
	                        <td class="RightContent"><%= news.Fetch_FetchType%> - <%= News.GetFetchContent(news.Fetch_FetchType, Convert.ToInt32(news.Fetch_FetchID))%></td>
	                    </tr>
	                    <tr>
	                        <td class="leftContent" valign="top" style="padding-top:5px;">报价单号：</td>
	                        <td class="RightContent"><%= news.Fetch_DanNum%></td>
	                    </tr><% } %>
	                    <%  if (news.ClsID.Contains("6"))
                            { %>
                        <tr>
	                        <td class="leftContent" valign="top" style="padding-top:5px;">物品：</td>
	                        <td class="RightContent"><%= news.Quote_StockType%> - <%= News.GetQuoteContent(news.Quote_StockType, Convert.ToInt32(news.Quote_StockID))%></td>
	                    </tr>
	                    <tr>
	                        <td class="leftContent" valign="top" style="padding-top:5px;">是否报价：</td>
	                        <td class="RightContent"><%= news.Quote_IsQuote%>：<%=news.Quote_Price %></td>
	                    </tr><% } %>
		                <tr>
		                    <td class="leftContent">预约人员：</td>
		                    <td class="RightContent">
		                      <asp:DropDownList ID="MUserKey" runat="server" CssClass="face">
		                        <asp:ListItem Value="" Selected="True">请选择预约任务相关人员</asp:ListItem>
		                      </asp:DropDownList>
		                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="MUserKey" ErrorMessage="请指定预约人员"></asp:RequiredFieldValidator>
		                    </td>
		                </tr>
	                    <tr>
	                        <td class="leftContent">预约上限时间：</td>
	                        <td class="RightContent">
                            日期:<asp:TextBox ID="TechOneD" runat="server" Width="70px" CssClass="face" ></asp:TextBox>&nbsp;
                            小时:<asp:TextBox ID="TechOneT_H" runat="server" Width="18px" CssClass="face"></asp:TextBox>
                                 <select id="TechOneT_H_sel" style="margin-left:-25px; position:absolute; clip:rect(auto 38px auto 22px);" onchange="SetT(this,'<%=TechOneT_H.ClientID  %>');">
                                    <option value=""></option>
                                    <option value="06">06</option>
                                    <option value="07">07</option>
                                    <option value="08">08</option>
                                    <option value="09">09</option>
                                    <option value="10">10</option>
                                    <option value="11">11</option>
                                    <option value="12">12</option>
                                    <option value="13">13</option>
                                    <option value="14">14</option>
                                    <option value="15">15</option>
                                    <option value="16">16</option>
                                    <option value="17">17</option>
                                    <option value="18">18</option>
                                    <option value="19">19</option>
                                    <option value="20">20</option>
                                    <option value="21">21</option>
                                    <option value="22">22</option>
                                 </select>
                            &nbsp;&nbsp;&nbsp;&nbsp;分钟:<asp:TextBox ID="TechOneT_M" runat="server" Width="18px" CssClass="face"></asp:TextBox>
	                        <select id="TechOneT_M_sel" style="margin-left:-25px; position:absolute; clip:rect(auto 38px auto 22px);" onchange="SetT(this,'<%=TechOneT_M.ClientID  %>');">
	                                <option value=""></option>
                                    <option value="00">00</option>
                                    <option value="05">05</option>
                                    <option value="10">10</option>
                                    <option value="15">15</option>
                                    <option value="20">20</option>
                                    <option value="25">25</option>
                                    <option value="30">30</option>
                                    <option value="35">35</option>
                                    <option value="40">40</option>
                                    <option value="45">45</option>
                                    <option value="50">50</option>
                                    <option value="55">55</option>
                                 </select>
	                        &nbsp;&nbsp;&nbsp;&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator12" 
                                    runat="server" ControlToValidate="TechOneD" Display="Dynamic" 
                                    ErrorMessage="请选择上限日期"></asp:RequiredFieldValidator>
                                     <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" 
                                    ControlToValidate="TechOneT_H" Display="Dynamic" ErrorMessage="请选择下限小时"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" 
                                    ControlToValidate="TechOneT_M" Display="Dynamic" ErrorMessage="请选择下限分钟"></asp:RequiredFieldValidator>
                            </td>
	                    </tr>
	                    <tr>
	                        <td class="leftContent">预约下限时间：</td>
	                        <td class="RightContent">
	                        日期:<asp:TextBox ID="TechTwoD" runat="server" Width="70px" CssClass="face"></asp:TextBox>&nbsp;
	                        小时:<asp:TextBox ID="TechTwoT_H" runat="server" Width="18px" CssClass="face"></asp:TextBox>
	                             <select id="TechTwoT_H_sel" style="margin-left:-25px; position:absolute; clip:rect(auto 38px auto 22px);" onchange="SetT(this,'<%=TechTwoT_H.ClientID  %>');">
	                                <option value=""></option>
                                    <option value="06">06</option>
                                    <option value="07">07</option>
                                    <option value="08">08</option>
                                    <option value="09">09</option>
                                    <option value="10">10</option>
                                    <option value="11">11</option>
                                    <option value="12">12</option>
                                    <option value="13">13</option>
                                    <option value="14">14</option>
                                    <option value="15">15</option>
                                    <option value="16">16</option>
                                    <option value="17">17</option>
                                    <option value="18">18</option>
                                    <option value="19">19</option>
                                    <option value="20">20</option>
                                    <option value="21">21</option>
                                    <option value="22">22</option>
                                 </select>
                                 &nbsp;&nbsp;&nbsp;&nbsp;分钟:<asp:TextBox ID="TechTwoT_M" runat="server" Width="18px" CssClass="face"></asp:TextBox>
                                <select id="TechTwoT_M_sel" style="margin-left:-25px; position:absolute; clip:rect(auto 38px auto 22px);" onchange="SetT(this,'<%=TechTwoT_M.ClientID  %>');">
                                        <option value=""></option>
                                        <option value="00">00</option>
                                        <option value="05">05</option>
                                        <option value="10">10</option>
                                        <option value="15">15</option>
                                        <option value="20">20</option>
                                        <option value="25">25</option>
                                        <option value="30">30</option>
                                        <option value="35">35</option>
                                        <option value="40">40</option>
                                        <option value="45">45</option>
                                        <option value="50">50</option>
                                        <option value="55">55</option>
                                 </select>
	                        &nbsp;&nbsp;&nbsp;
	                            <asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" 
                                    ControlToValidate="TechTwoD" Display="Dynamic" ErrorMessage="请选择下限日期"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server" 
                                    ControlToValidate="TechTwoT_H" Display="Dynamic" ErrorMessage="请选择下限小时"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" 
                                    ControlToValidate="TechTwoT_M" Display="Dynamic" ErrorMessage="请选择下限分钟"></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="CustomValidator2" runat="server" 
                                    ClientValidationFunction="CV1" ControlToValidate="TechTwoT_M" 
                                    ErrorMessage="上限时间必须小于下限时间" ValidateEmptyText="True"></asp:CustomValidator>
	                        </td>
	                    </tr>
	                     <tr>
	                        <td class="leftContent">报修人姓名：</td>
	                        <td class="RightContent"><%= news.UserName %></td>
	                    </tr>
	                    <tr>
	                        <td class="leftContent">公司名称：</td>
	                        <td class="RightContent"><%= news.UserCompany %></td>
	                    </tr>
	                    <tr>
	                        <td class="leftContent">报修人联系方式：</td>
	                        <td class="RightContent"><%= news.UserNameTEL %></td>
	                    </tr>
	                     <tr>
	                        <td class="leftContent">协调备注：</td>
	                        <td class="RightContent"><asp:TextBox 
                                    ID="Content_Scheduling" runat="server" Width="327px" CssClass="face" 
                                    Height="50px" TextMode="MultiLine"></asp:TextBox></td>
	                    </tr>
	                    <tr>
	                        <td class="leftContent" valign="top" style="padding-top:20px;height:30px;"></td>
	                        <td class="RightContent">
                            <asp:Button ID="btnSubmit" runat="server" Text="确 定" CssClass="button" 
                                    onclick="btnSubmit_Click" />
	                        &nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重 置" name="btnReset" class="button"></td>
	                    </tr>
	                  </form>  
	                </table>
				</td>
		    </tr>
		</table>
        </td>
    </tr>
</table>
</asp:Content>

